﻿using System;
using System.Text;

namespace HslCommunication.Core
{
	/// <summary>
	/// 支持转换器的基础接口，规定了实际的数据类型和字节数组进行相互转换的方法。
	/// </summary>
	/// <remarks>
	/// 所有的设备通讯类都内置了该转换的模型，并且已经配置好数据的高地位模式，可以方便的转换信息
	/// </remarks>
	// Token: 0x02000125 RID: 293
	public interface IByteTransform
	{
		/// <summary>
		/// 从缓存中提取出bool结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">位的索引</param>
		/// <returns>bool对象</returns>
		// Token: 0x06001902 RID: 6402
		bool TransBool(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取出bool数组结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">位的索引</param>
		/// <param name="length">bool长度</param>
		/// <returns>bool数组</returns>
		// Token: 0x06001903 RID: 6403
		bool[] TransBool(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取byte结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <returns>byte对象</returns>
		// Token: 0x06001904 RID: 6404
		byte TransByte(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取byte数组结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">读取的数组长度</param>
		/// <returns>byte数组对象</returns>
		// Token: 0x06001905 RID: 6405
		byte[] TransByte(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取short结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <returns>short对象</returns>
		// Token: 0x06001906 RID: 6406
		short TransInt16(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取short数组结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">读取的数组长度</param>
		/// <returns>short数组对象</returns>
		// Token: 0x06001907 RID: 6407
		short[] TransInt16(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取ushort结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <returns>ushort对象</returns>
		// Token: 0x06001908 RID: 6408
		ushort TransUInt16(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取ushort数组结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">读取的数组长度</param>
		/// <returns>ushort数组对象</returns>
		// Token: 0x06001909 RID: 6409
		ushort[] TransUInt16(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取int结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <returns>int对象</returns>
		// Token: 0x0600190A RID: 6410
		int TransInt32(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取int数组结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">读取的数组长度</param>
		/// <returns>int数组对象</returns>
		// Token: 0x0600190B RID: 6411
		int[] TransInt32(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取uint结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <returns>uint对象</returns>
		// Token: 0x0600190C RID: 6412
		uint TransUInt32(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取uint数组结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">读取的数组长度</param>
		/// <returns>uint数组对象</returns>
		// Token: 0x0600190D RID: 6413
		uint[] TransUInt32(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取long结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <returns>long对象</returns>
		// Token: 0x0600190E RID: 6414
		long TransInt64(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取long数组结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">读取的数组长度</param>
		/// <returns>long数组对象</returns>
		// Token: 0x0600190F RID: 6415
		long[] TransInt64(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取ulong结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <returns>ulong对象</returns>
		// Token: 0x06001910 RID: 6416
		ulong TransUInt64(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取ulong数组结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">读取的数组长度</param>
		/// <returns>ulong数组对象</returns>
		// Token: 0x06001911 RID: 6417
		ulong[] TransUInt64(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取float结果
		/// </summary>
		/// <param name="buffer">缓存对象</param>
		/// <param name="index">索引位置</param>
		/// <returns>float对象</returns>
		// Token: 0x06001912 RID: 6418
		float TransSingle(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取float数组结果
		/// </summary>
		/// <param name="buffer">缓存数据</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">读取的数组长度</param>
		/// <returns></returns>
		// Token: 0x06001913 RID: 6419
		float[] TransSingle(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取double结果
		/// </summary>
		/// <param name="buffer">缓存对象</param>
		/// <param name="index">索引位置</param>
		/// <returns>double对象</returns>
		// Token: 0x06001914 RID: 6420
		double TransDouble(byte[] buffer, int index);

		/// <summary>
		/// 从缓存中提取double数组结果
		/// </summary>
		/// <param name="buffer">缓存对象</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">读取的数组长度</param>
		/// <returns></returns>
		// Token: 0x06001915 RID: 6421
		double[] TransDouble(byte[] buffer, int index, int length);

		/// <summary>
		/// 从缓存中提取string结果，使用指定的编码
		/// </summary>
		/// <param name="buffer">缓存对象</param>
		/// <param name="encoding">字符串的编码</param>
		/// <returns>string对象</returns>
		// Token: 0x06001916 RID: 6422
		string TransString(byte[] buffer, Encoding encoding);

		/// <summary>
		/// 从缓存中提取string结果，使用指定的编码
		/// </summary>
		/// <param name="buffer">缓存对象</param>
		/// <param name="index">索引位置</param>
		/// <param name="length">byte数组长度</param>
		/// <param name="encoding">字符串的编码</param>
		/// <returns>string对象</returns>
		// Token: 0x06001917 RID: 6423
		string TransString(byte[] buffer, int index, int length, Encoding encoding);

		/// <summary>
		/// bool变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001918 RID: 6424
		byte[] TransByte(bool value);

		/// <summary>
		/// bool数组变量转化缓存数据
		/// </summary>
		/// <param name="values">等待转化的数组</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001919 RID: 6425
		byte[] TransByte(bool[] values);

		/// <summary>
		/// byte变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x0600191A RID: 6426
		byte[] TransByte(byte value);

		/// <summary>
		/// short变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x0600191B RID: 6427
		byte[] TransByte(short value);

		/// <summary>
		/// short数组变量转化缓存数据
		/// </summary>
		/// <param name="values">等待转化的数组</param>
		/// <returns>buffer数据</returns>
		// Token: 0x0600191C RID: 6428
		byte[] TransByte(short[] values);

		/// <summary>
		/// ushort变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x0600191D RID: 6429
		byte[] TransByte(ushort value);

		/// <summary>
		/// ushort数组变量转化缓存数据
		/// </summary>
		/// <param name="values">等待转化的数组</param>
		/// <returns>buffer数据</returns>
		// Token: 0x0600191E RID: 6430
		byte[] TransByte(ushort[] values);

		/// <summary>
		/// int变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x0600191F RID: 6431
		byte[] TransByte(int value);

		/// <summary>
		/// int数组变量转化缓存数据
		/// </summary>
		/// <param name="values">等待转化的数组</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001920 RID: 6432
		byte[] TransByte(int[] values);

		/// <summary>
		/// uint变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001921 RID: 6433
		byte[] TransByte(uint value);

		/// <summary>
		/// uint数组变量转化缓存数据
		/// </summary>
		/// <param name="values">等待转化的数组</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001922 RID: 6434
		byte[] TransByte(uint[] values);

		/// <summary>
		/// long变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001923 RID: 6435
		byte[] TransByte(long value);

		/// <summary>
		/// long数组变量转化缓存数据
		/// </summary>
		/// <param name="values">等待转化的数组</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001924 RID: 6436
		byte[] TransByte(long[] values);

		/// <summary>
		/// ulong变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001925 RID: 6437
		byte[] TransByte(ulong value);

		/// <summary>
		/// ulong数组变量转化缓存数据
		/// </summary>
		/// <param name="values">等待转化的数组</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001926 RID: 6438
		byte[] TransByte(ulong[] values);

		/// <summary>
		/// float变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001927 RID: 6439
		byte[] TransByte(float value);

		/// <summary>
		/// float数组变量转化缓存数据
		/// </summary>
		/// <param name="values">等待转化的数组</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001928 RID: 6440
		byte[] TransByte(float[] values);

		/// <summary>
		/// double变量转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <returns>buffer数据</returns>
		// Token: 0x06001929 RID: 6441
		byte[] TransByte(double value);

		/// <summary>
		/// double数组变量转化缓存数据
		/// </summary>
		/// <param name="values">等待转化的数组</param>
		/// <returns>buffer数据</returns>
		// Token: 0x0600192A RID: 6442
		byte[] TransByte(double[] values);

		/// <summary>
		/// 使用指定的编码字符串转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <param name="encoding">字符串的编码方式</param>
		/// <returns>buffer数据</returns>
		// Token: 0x0600192B RID: 6443
		byte[] TransByte(string value, Encoding encoding);

		/// <summary>
		/// 使用指定的编码字符串转化缓存数据
		/// </summary>
		/// <param name="value">等待转化的数据</param>
		/// <param name="length">转换之后的数据长度</param>
		/// <param name="encoding">字符串的编码方式</param>
		/// <returns>buffer数据</returns>
		// Token: 0x0600192C RID: 6444
		byte[] TransByte(string value, int length, Encoding encoding);

		/// <summary>
		/// 获取或设置数据解析的格式，可选ABCD, BADC，CDAB，DCBA格式，对int,uint,float,double,long,ulong类型有作用<br />
		/// Get or set the format of the data analysis, optional ABCD, BADC, CDAB, DCBA format, effective for int, uint, float, double, long, ulong type
		/// </summary>
		// Token: 0x1700053B RID: 1339
		// (get) Token: 0x0600192D RID: 6445
		// (set) Token: 0x0600192E RID: 6446
		DataFormat DataFormat { get; set; }

		/// <summary>
		/// 获取或设置在解析字符串的时候是否将字节按照字单位反转<br />
		/// Gets or sets whether to reverse the bytes in word units when parsing strings
		/// </summary>
		// Token: 0x1700053C RID: 1340
		// (get) Token: 0x0600192F RID: 6447
		// (set) Token: 0x06001930 RID: 6448
		bool IsStringReverseByteWord { get; set; }

		/// <summary>
		/// 根据指定的<see cref="P:HslCommunication.Core.IByteTransform.DataFormat" />格式，来实例化一个新的对象，除了<see cref="P:HslCommunication.Core.IByteTransform.DataFormat" />不同，其他都相同<br />
		/// According to the specified <see cref="P:HslCommunication.Core.IByteTransform.DataFormat" /> format, to instantiate a new object, except that <see cref="P:HslCommunication.Core.IByteTransform.DataFormat" /> is different, everything else is the same
		/// </summary>
		/// <param name="dataFormat">数据格式</param>
		/// <returns>新的<see cref="T:HslCommunication.Core.IByteTransform" />对象</returns>
		// Token: 0x06001931 RID: 6449
		IByteTransform CreateByDateFormat(DataFormat dataFormat);
	}
}
